/*
 * @(#)DateUtils.java $version 2013. 4. 23.
 *
 * Copyright 2007 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package com.catchdays.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import android.util.Log;

public class DateUtils {
	private static String TAG = "DateUtils";

	private static SimpleDateFormat format = new SimpleDateFormat("yyyymmdd", Locale.KOREA);
	private static Calendar calendar = Calendar.getInstance();

	public static int getMonth(String yyyymmdd) {
		Date date = null;

		try {
			date = format.parse(yyyymmdd);
		} catch (ParseException e) {
			Log.e(TAG, "parse error", e);
		}
		calendar.setTime(date);

		return calendar.get(Calendar.MONTH);
	}
}
